//获取秒针的dom结构（const 定义变量）
const secondHand=document.querySelector('.second-hand')
const minHand=document.querySelector('.min-hand')
const hourHand=document.querySelector('.hour-hand')
//console.log(secondHand,minHand,hourdHand);
function setDate(){
const now=new Date()
//获取当前秒
const seconds= now.getSeconds()
const  secondsDegrees=((seconds/60)*360)+90
// console.log(secondsDegrees);
secondHand.style.transform=`rotate(${secondsDegrees}deg)`
//获取当前分
const mins= now.getMinutes()
const  minsDegrees=((mins/60)*360)+((seconds/60)*6)+90
// console.log(secondsDegrees);
minHand.style.transform=`rotate(${minsDegrees}deg)`
//获取当前时
const hour= now.getHours()
console.log(hour);
 const  hoursDegrees=((hour%12)*30)+((mins/60)*30)+90
 //console.log(hoursDegrees);
hourHand.style.transform=`rotate(${hoursDegrees}deg)`


}
setInterval(setDate,1000)//每隔一秒调用一次
setDate()